package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DishMapper {

    void insertOnlyDish(Dish dish);

    Page<Dish> pageQuery(DishPageQueryDTO dishPageQueryDTO);


    @Select("SELECT * FROM dish WHERE id = #{id}")
    Dish selectById(Long id);  // 正确：返回单个对象

    void deleteOnlyDishByIds(List<Long> ids);





    void update(Dish dish);

    @Update("update dish set status=#{status} where id=#{id}")
    void startOrStop(Integer status, Long id);


    @Select("select * from dish where category_id=#{categoryId}")
    List<Dish> selectDishByCategoryId(Integer categoryId);


    List<Dish> list(Dish dish);

    @Select("select * from dish where id=#{id}")
    Dish getById(Long dishId);
}
